import os
from spider import Spider, Task


async def runTask(task: Task, data: bytes):
    with open(os.path.basename(task.url), "wb") as f:
        f.write(data)


def main():
    spider = Spider(runTask)
    spider.addTask("")
    spider.runTask()


if __name__ == "__main__":
    main()
